<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Modificar Monta</title>
</head>
<?php

include ("../PHP/validarSesion.php");
include("../PHP/BaseDatos.php");
$link=Conectarse();

$codigo=$_REQUEST["codigo"];
$sql="select * from monta where codMonta=$codigo;";
$result = mysql_query($sql,$link);
$datos = mysql_fetch_array($result); 
?>
<body>
<form name="formModificarMonta" method="get" action="../PHP/ModificarMonta.php">
	<table align="center" border="0">
    	<tr>
        	<td colspan="2" align="center">Modificar Monta</td>
        </tr>
        <tr>
        	<td>Código Monta:</td>
            <td><input type="text" id="codMonta" name="codMonta" value="<?php echo $datos["codMonta"]?>" readonly></td>
        </tr>
         <tr>
        	<td>Código Reproductor:</td>
            <td>
                 	<?php
						$result=mysql_query("select codReproductor from asignarconejas where codReproductora=9;",$link);
						$row=mysql_fetch_array($result);
					?>
                <input type="text" name="codReproductor" id="codReproductor" value="<?php echo $row["codReproductor"];?>" readonly>
            </td>
        </tr>
        <tr>
        	<td>Palpación:</td>
            <td>
            	<select name="palpacion" id="palpacion">
                  <?php
					if($datos["palpacionMonta"]=="+")
					 {
				  ?>
                  		<option value="+" selected>+</option>
                        <option value="-">-</option>
                        <option value="?">?</option>
                        
                   <?php
					 }
									                
					else if($datos["palpacionMonta"]=="-")
					 {
				  ?>
                  		<option value="+">+</option>                  
    			  		<option value="-" selected>-</option>
                        <option value="?">?</option>
                   <?php
					 }				
                    			
                   else if($datos["palpacionMonta"]=="?")
					 {
				  ?>
                  		<option value="+">+</option>                  
    			  		<option value="-" >-</option>
                        <option value="?" selected>?</option>
                   <?php
					 }
					 else
					 {
				   ?>
                    	<option value="+">+</option>                  
    			  		<option value="-">-</option>
                        <option value="?">?</option>
                    
                    <?php
					 }
					?>
                </select>
            </td>
        </tr>
        <tr>
        	<td>Fecha:</td>
            <td><input type="date" id="fecha" name="fecha" value="<?php echo $datos["fechaMonta"];?>" required></td>
        </tr>
        <tr>
        </tr>
        <tr>
        	<td>Número de Intentos:</td>
            <td><input type="text" id="numIntentos" name="numIntentos" value="<?php echo $datos["numeroIntentos"];?>" required></td>
        </tr>
        <tr>
        	<td>Libido Coneja:</td>
            <td>
            	<select name="libidoConeja" id="libidoConeja">
                <?php
					if($datos["libidoConeja"]==0)
					{
				?>
                	<option value="0" selected>0</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="+4">+4</option>
                 <?php
					}
					else if($datos["libidoConeja"]==2)
					{
				?>
                    <option value="0">0</option>
                    <option value="2" selected>2</option>
                    <option value="3">3</option>
                    <option value="+4">+4</option>
                <?php
					}
					else if($datos["libidoConeja"]==3)
					{
                ?>
                	<option value="0">0</option>
                    <option value="2">2</option>
                    <option value="3" selected>3</option>
                    <option value="+4">+4</option>
                <?php
					}
					else
					{
				?>
                	<option value="0">0</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="+4" selected>+4</option>
                <?php
					}
				?>
                </select>
            </td>
        </tr>
         <tr>
        	<td>Libido Conejo:</td>
            <td>
            	<select name="libidoConejo" id="libidoConejo">
                	 <?php
					if($datos["libidoConejo"]==0)
					{
				?>
                	<option value="0" selected>0</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="+4">+4</option>
                 <?php
					}
					else if($datos["libidoConejo"]==2)
					{
				?>
                    <option value="0">0</option>
                    <option value="2" selected>2</option>
                    <option value="3">3</option>
                    <option value="+4">+4</option>
                <?php
					}
					else if($datos["libidoConejo"]==3)
					{
                ?>
                	<option value="0">0</option>
                    <option value="2">2</option>
                    <option value="3" selected>3</option>
                    <option value="+4">+4</option>
                <?php
					}
					else
					{
				?>
                	<option value="0">0</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="+4" selected>+4</option>
                <?php
					}
				?>
                </select>
            </td>
        </tr>
        <tr>
        	<td>Observaciones</td>
            <td>
            	<textarea id="observaciones" name="observaciones" cols="17.5" rows="5" required><?php echo $datos["observaciones"];?></textarea> 
            </td>
        </tr>
        <tr>
        	<td colspan="2" align="center"><input type="submit" name="modificar" value="Modificar"></td>
        </tr>
    </table>
</form>
</body>
</html>